package com.fengmi.mapper;

import com.fengmi.entity.MallGoodsBrand;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 作者：陈学虎
 * 时间：2021/7/6 0006 下午 4:59
 */
@Mapper
public interface MallGoodsBrandMapper {
    //分页+条件查询
    List<MallGoodsBrand> findBrandByWhere(MallGoodsBrand mallGoodsBrand);

    //删除一个
    @Delete("delete from mall_goods_brand where id = #{id}")
    int delById(int id);

    //添加
    @Insert("insert into mall_goods_brand (name,first_letter,show_status,logo) values (#{name},#{firstLetter},#{showStatus},#{logo})")
    int addBrand(MallGoodsBrand mallGoodsBrand);

    //批量删除
    int delBactch(@Param("mallGoodsBrandList") List<MallGoodsBrand> mallGoodsBrandList);

    //修改
    int updateBrand(MallGoodsBrand mallGoodsBrand);

    //查一个
    @Select("select * from mall_goods_brand where id = #{id}")
    MallGoodsBrand findOne(int id);

    @Select("select * from mall_goods_brand")
    List<MallGoodsBrand> findBrand();


}
